package com.zlt.service;

import java.sql.SQLException;
import java.util.Date;
import java.util.List;
import java.util.UUID;

import com.zlt.entity.ChatMessageDetail;
import com.zlt.entity.ChatMessageMain;
import com.zlt.vo.ChatMessageVo;
import com.zlt.vo.ChatVo;

public interface ChatMessageService {

    List<ChatVo> showUserChatList(String token);


    int addMain(ChatMessageMain chatMessageMain);

    int addDetail(int mainId, String thisUUID, String userUid, Character type, Object content, Date date, Character hasRead);

    int addDetail(ChatMessageDetail chartMessageDetail) throws SQLException;

    /**
     * 将消息记录存到数据库中
     *
     * @param src  源
     * @param dest 目的
     */
    Integer addMain(String src, String dest);

    /**
     * 记录消息详情
     *
     * @param mainId  消息列表id
     * @param uid     发送者id
     * @param to      接受者id
     * @param content 内容
     * @param hasRead 是否已读
     * @return
     */

    Integer addDetail(Integer mainId, String uid, String to, String content, char hasRead) throws SQLException;

    /**
     * 返回聊天对象列表<br/>
     * 没有返回null
     *
     * @param uid
     * @return
     */
    List<ChatMessageMain> chatList(String uid);

    /**
     * 查询聊天记录
     *
     * @param src 发送者
     * @param dest 接受者
     * @return
     */
    List<ChatMessageDetail> chatDetailList(String src, String dest);

    Integer addMainTable(String user1, String user2, String cid, String jid);

    List<ChatMessageVo> showChatsByPhone(String token, String phone);

    Integer getMainId(String uid1, String uid2);
}
